package com.lhys.mapper;

import com.lhys.pojo.AssetProvider;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 资产_供应商表 Mapper 接口
 * </p>
 *
 * @author 小七
 * @since 2021-05-06
 */
public interface AssetProviderMapper {
    @Insert("INSERT INTO `asset_provider` (`title`, `provider_type_id`, `status`, `provider_name`, `provider_phone`, `provider_address`, `create_time`) VALUES (#{title}, #{providerTypeId}, #{status}, #{providerName}, #{providerPhone}, #{providerAddress}, #{createTime})")
    Integer addAssetProvider(AssetProvider assetProvider);

    @Delete("delete from asset_provider where id = #{id}")
    Integer delAssetProvider(Integer id);

    Integer updateAssetProvider(AssetProvider assetProvider);

    @Select("select * from asset_provider where id = #{id}")
    AssetProvider getAssetProviderById(Integer id);

    List<AssetProvider> getAssetProviderByStatusAndProviderTypeIdAndTitleList(AssetProvider assetProvider);

    @Select("select * from asset_provider where title = #{title}")
    AssetProvider getAssetProviderByTitle(String title);
}
